package com.eastfair.venuebooking.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.eastfair.annotation.annotation.vo.VoInfo;
import com.eastfair.venuebooking.demand.QuotationGroup;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 报价书 DTO.
 *
 * @author dqq
 * @date 2022 /6/21
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Builder
public class QuotationDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    public interface Save {
    }

    public interface Update {
    }

    public interface SaveExhibition {
    }

    @NotNull(message = "报价书id不可为空", groups = {Update.class})
    private Long id;

    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    private Integer isEnabled;
    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    private Integer isDeleted;
    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    private Long projectId;
    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    private Long subsystemId;
    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    private Long tenantId;
    /**
     * 商机id
     */
    @ApiModelProperty(value = "商机id")
    private Long opportunityId;
    /**
     * 展会
     */
    @ApiModelProperty(value = "展会")
    @NotNull(message = "展会id不可为空", groups = {SaveExhibition.class})
    private Long exhibitionId;
    /**
     * 价目ID
     */
    @ApiModelProperty("价目ID")
    private Long priceListId;
    /**
     * 场地保证金
     */
    @ApiModelProperty(value = "场地保证金")
    @NotNull(message = "场地保证金不可为空", groups = {Save.class})
    private BigDecimal splaceBondAmount;
    /**
     * 服务保证金
     */
    @ApiModelProperty(value = "服务保证金")
    @NotNull(message = "服务保证金不可为空", groups = {Save.class})
    private BigDecimal serviceBondAmount;
    /**
     * 总金额（折扣前）
     */
    @ApiModelProperty(value = "总金额（折扣前）")
    @NotNull(message = "总金额不可为空", groups = {Save.class})
    private BigDecimal totalAmount;
    /**
     * 折扣后总价
     */
    @ApiModelProperty(value = "折扣后总价")
    @NotNull(message = "折扣后总价不可为空", groups = {Save.class})
    private BigDecimal discountAmount;

    /**
     * 折扣场地服务
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @VoInfo(groups = {QuotationGroup.QueryQuotation.class})
    private BigDecimal spaceAmount;
    /**
     * 弃用 计价单位(数据字典) 弃用
     */
    @ApiModelProperty(value = "计价单位(数据字典)")
    @Size(max = 255, message = "计价单位(数据字典)长度不能超过255")
    private String priceUnit;
    /**
     * 弃用 单位尺 1 时   2 天（“平米/天”，“每天对”应“天”    “平米/小时“，”每小时“对应”时“）
     */
    @ApiModelProperty(value = "单位尺 1 时   2 天（“平米/天”，“每天对”应“天”    “平米/小时“，”每小时“对应”时“）")
    private Integer unitRuler;
    /**
     * 报价书标题
     */
    @ApiModelProperty(value = "报价书标题")
    @Size(max = 255, message = "报价书标题长度不能超过255", groups = {Save.class})
    @NotBlank(message = "报价书标题不可为空", groups = {Save.class})
    private String quotationTitle;

    /**
     * 报价书详情列表
     */
    @ApiModelProperty(value = "报价书详情列表")
    @NotEmpty(message = "报价书详情列表不可为空", groups = {Save.class})
    private List<QuotationDetailDTO> quotationDetailList;

    /**
     * 报价书详情id列表
     */
    @ApiModelProperty(value = "报价书详情id列表")
    private List<Long> quotationDetailIdList;

    /**
     * 已经生成了合同的报价书ID列表
     */
    @ApiModelProperty(value = "已经生成了合同的报价书ID列表")
    private List<Long> hasCreateContractQuotationIdList;
}
